package com.sand.controller;

import com.sand.dto.Owner.AddOwner;
import com.sand.dto.Owner.OwnerDto;
import com.sand.dto.Select.UserSelect;
import com.sand.result.ResponseResult;
import com.sand.service.OwnerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/owner")
public class OwnerController {

    @Autowired
    private OwnerService ownerService;


    /**
     * 新增客户
     *
     */
    @PostMapping("/add")
    public ResponseResult<String> addOwner(@RequestBody AddOwner addOwner){
        String i =  ownerService.addOwner(addOwner);
        return new ResponseResult<String>().okResult(i);
    }



    /**
     * 修改客户意向度
     */


    /**
     * 查询客户(完成)
     */
    @PostMapping("/select")
    public ResponseResult<OwnerDto> select(@RequestBody UserSelect userSelect){

        OwnerDto ownerDto =  ownerService.select(userSelect);

        return new ResponseResult<OwnerDto>().okResult(ownerDto);
    }


}
